<?php
////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) ReloadCMS Development Team                                 //
//   http://reloadcms.sf.net                                                  //
//                                                                            //
//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
//                                                                            //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
header("Content-type: image/png");
class captcha {
//method which draws counter image
function draw($showtext){
$image = imagecreatefrompng("skins/icon.png");
$colorBackgr = imageColorAllocate($image, 0, 0, 0);
$colorText = imageColorAllocate($image, 255, 255, 255);
imageString($image, 5, 20, 9,  $showtext ,$colorText);
imagePNG($image);
}

//method that draws entered value
function capt_get() {
	if (isset($_GET['ident']))
	{
		if (!empty($_GET['ident'])) {
		$result=substr(md5($_GET['ident']),0,5);
		
		}
	}
	else {
		$result='';
	}
return ($result);
}
}
$captcha= new captcha();
$captcha->draw($captcha->capt_get());
?>
